From 4911eef232448e99ce6242bbe92d5158e394f327 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 2 Jan 2005 07:10:30 +0000 Subject: [PATCH] Really fix the math to make the vectors sum up to 1, making 2005-01-02 Matthias Clasen * pixops/pixops.c (bilinear_box_make_weights): Really fix the math to make the vectors sum up to 1, making GDK_INTERP_HYPER work again. (#162703, Dennis Nezic) --- gdk-pixbuf/ChangeLog | 6 ++++++ gdk-pixbuf/pixops/pixops.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 2b453a37bc..215b28320a 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,9 @@ +2005-01-02 Matthias Clasen + + * pixops/pixops.c (bilinear_box_make_weights): Really fix the + math to make the vectors sum up to 1, making GDK_INTERP_HYPER + work again. (#162703, Dennis Nezic) + 2004-12-27 Matthias Clasen * gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file) diff --git a/gdk-pixbuf/pixops/pixops.c b/gdk-pixbuf/pixops/pixops.c index e263c13d16..cd7f493f79 100644 --- a/gdk-pixbuf/pixops/pixops.c +++ b/gdk-pixbuf/pixops/pixops.c @@ -1313,7 +1313,7 @@ static void bilinear_box_make_weights (PixopsFilterDimension *dim, double scale) { - int n = ceil (1/scale + 2.0); + int n = ceil (1/scale + 3.0); double *pixel_weights = g_new (double, SUBSAMPLE * n); double w; int offset, i; @@ -1330,7 +1330,7 @@ bilinear_box_make_weights (PixopsFilterDimension *dim, for (i = 0; i < n; i++) { w = linear_box_half (0.5 + i - a, 0.5 + i - x); - w += linear_box_half (0.5 + x - i, 0.5 + a - i); + w += linear_box_half (1.5 + x - i, 1.5 + a - i); *(pixel_weights++) = w * scale; } -- 2.30.2